package controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/7/28 9:42
 * Version:1.0-SNAPSHOT
 * Description:
 */
public class HelloController implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mav = new ModelAndView();
        mav.setViewName("hello");
        mav.addObject("msg","Hello SpringMVC");
        // request.setAttribute("msg","Hello SpringMVC");
        return mav;
    }
}
